<html lang="zh" xmlns:wb="http://open.weibo.com/wb">
{% block ext_css %}
    <link href="{{ url_for('static',filename='bootstrap/css/bootstrap.min.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ url_for('static',filename='css/bootstrap/bootstrap-responsive.min.css') }}" rel="stylesheet"
          type="text/css">
    <link href="{{ url_for('static',filename='css/bootstrap/bootstrap-datatables.css') }}" rel="stylesheet"
          type="text/css">
    <link href="{{ url_for('static',filename='ext/bootstrap-sco/css/scojs.css') }}" rel="stylesheet" type="text/css">
    <link href="{{ url_for('static',filename='ext/bootstrap-sco/css/sco.message.css') }}" rel="stylesheet"
          type="text/css">
{% endblock %}
{% block meta %}
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html;IE=edge;width=device-width, initial-scale=1; charset=utf-8"/>
{% endblock %}
<head>
    <meta name="uyan_auth" content="a8ec133338"/>
    <link rel="shortcut icon" type="image/x-ico" href="{{ url_for('static',filename='images/favicon.ico') }}">
    <link rel="icon" type="image/x-ico" href="{{ url_for('static',filename='images/favicon.ico') }}">
    {% if title %}
        <title>
            {{ blog_name }}-{{ title }}
        </title>
    {% else %}
        <title>{{ blog_name }}</title>
    {% endif %}
</head>
<body>
{% block head %}
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                        aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">zblog</span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{{ url_for('main.index') }}">{{ blog_name }}</a>
            </div>
            <div id="navbar" class="collapse navbar-collapse ">
                <ul class="nav navbar-nav">
                    {% for f in first_bar %}
                        {% if request.url_rule.endpoint==f.value %}
                            <li class="active"><a href="{{ url_for(f.value) }}"><span
                                    class="{{ f.icon }}"></span> {{ f.name }}</a>
                            </li>
                        {% else %}
                            <li><a href="{{ url_for(f.value) }}"><span class="{{ f.icon }}"></span> {{ f.name }}</a>
                            </li>
                        {% endif %}
                    {% endfor %}
                </ul>
                {% with messages = get_flashed_messages() %}
                    {% if messages %}
                        {% for message in messages %}
                            <li id="msg" class="center-block" style="list-style-type: none">
                                <a class="btn-navbar btn-warning affix">
                                    <span class="glyphicon glyphicon-exclamation-sign"></span> {{ message }}
                                </a>
                            </li>
                        {% endfor %}
                    {% endif %}
                {% endwith %}
                {% if g.user.is_authenticated() %}
                    <div class="pull-right  btn-group ">
                        {% if g.user.is_admin() %}
                            <a href="{{ url_for('article.create') }}" class="btn btn-link navbar-btn">
                                <span class="glyphicon glyphicon-plus blue"></span> 新增文章</a>
                            <button class="btn btn-link dropdown-toggle navbar-btn" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user red"></i><span
                                    class="hidden-sm hidden-xs"> 管理员</span>
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu ">
                        {% else %}
                            <button class="btn btn-link dropdown-toggle navbar-btn" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user red"></i><span class="hidden-sm hidden-xs"> 用户</span>
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu ">
                        {% endif %}
                        <li><a href={{ url_for('admin.index') }}>
                            <i class="glyphicon glyphicon-wrench "></i> 后台管理</a></li>
                        <li><a href="{{ url_for('user.usereditinfo') }}">
                            <i class="glyphicon glyphicon-wrench "></i> 个人设置</a></li>
                        <li class="divider"></li>
                        <li><a href="{{ url_for('user.logout') }}">
                            <i class="glyphicon glyphicon-log-out "></i> 退出系统</a></li>
                        </ul>
                    </div>
                {% else %}
                    <div class="navbar-right btn-group ">
                        <a href="{{ url_for('user.register') }}" class="btn btn-link navbar-btn">
                            <span class="glyphicon glyphicon-user red"></span> 注册</a>
                        <a href="{{ url_for('user.login') }}" class="btn btn-link navbar-btn">
                            <span class="glyphicon glyphicon-log-in red"></span> 登陆</a>
                    </div>
                {% endif %}
            </div>
        </div>
    </nav>
    <br/>
    <br/>
    <br/>
{% endblock %}
{% block list_bar %}
{% endblock %}
{% block content %}
{% endblock %}
{% block footer %}
    <hr class="ke-hr"/>
    <footer class="alert modal-footer" style="text-align: center">
        链接：|
        <a target="_blank" href="http://www.pythondoc.com/pythontutorial27/index.html" class="alert-link">Python</a>|
        <a target="_blank" href="http://dormousehole.readthedocs.org/en/latest/" class="alert-link">Flask</a>|
        <a target="_blank" href="http://www.sqlalchemy.org/" class="alert-link">sqlalchemy</a>|
        <a target="_blank" href="http://getbootstrap.com/" class="alert-link">Bootstrap</a>|
        <a target="_blank" href="http://glyphicons.com/" class="alert-link">Glyphicons </a>|
        <a target="_blank" href="http://zousj.cn" class="alert-link">Zousj.cn </a><br/>
        联系作者：
        <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=874756674&site=qq&menu=yes"><img border="0"
                                                                                                  src="http://wpa.qq.com/pa?p=2:120225883:51"
                                                                                                  alt="点击这里给我发消息"
                                                                                                  title="点击这里给我发消息"/></a>
        |
        <a target="_blank" href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=uoKNjo2PjIyNjvrLy5TZ1dc"
           style="text-decoration:none;"><img
                src="http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_mailme_01.png"/></a><br/>
        <strong class="text-success">Copyright 2015 by golsee</strong>

    </footer>
{% endblock %}
{% block script %}
    <script type="text/javascript" src="{{ url_for('static', filename='js/jquery/jquery-2.1.1.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='bootstrap/js/bootstrap.min.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='js/bootstrap/bootstrap-datatables.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/charisma.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='js/jquery/jquery.dataTables.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='ext/bootstrap-sco/js/sco.modal.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/bootstrap-sco/js/sco.confirm.js') }}"></script>
    <script type="text/javascript"
            src="{{ url_for('static', filename='ext/bootstrap-sco/js/sco.tooltip.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/jquery/jquery.pin.min.js') }}"></script>

    <script type="text/javascript">
        //渐入
        function msgin() {
            $("#msg").fadeIn();
        }
        /*两秒消失*/
        function msgout() {
            $("#msg").fadeOut();
        }
        setTimeout("msgin()", 500);
        setTimeout("msgout()", 2500);
    </script>
    <script type="text/javascript">
        $(".pinned").pin({padding: {top: 50, bottom: 10}})
    </script>
    <!--百度统计-->
    <script type="text/javascript">
        var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
        document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F07ec26fb513e622f7cb699dcaa5489cb' type='text/javascript'%3E%3C/script%3E"));
    </script>
{% endblock %}
</body>
</html>
